<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>callback</title>
</head>

<body>
    <script src="../src/ajax.js"></script>
    <script>
        Ajax({
            method: 'get',
            url: '/base/get',
            params: {
                foo: {
                    bar: 'baz'
                }
            },
            before: function (config) {
                console.log('before-config', config)
            },
            after: function (response) {
                console.log('after-response', response)
            },
        })

        Ajax({
            method: 'post',
            url: '/base/post',
            data: {
                a: 1,
                b: 2
            },
            before: function (config) {
                console.log('before-config', config)
            },
            after: function (response) {
                console.log('after-response', response)
            },
        })
    </script>
</body>

</html>